<%@ page import='bean.Tail' %>
<%@ page import='java.util.List' %>
<%@ page contentType='text/html;charset=UTF-8' language='java' %>
<html>
<head>
    <title>tail</title>
  <style type='text/css'>
    a{
      text-decoration: none;
      color:black;
    }
    a:hover{
      text-decoration: underline;
      color:pink;
      cursor:pointer;
      text-align: center;
    }
    table{
      border: 1px solid pink;
      border-collapse: collapse;
      height: 250px;
      width: 500px;
    }

  </style>
</head>
<body>
<h2><a href='<%=request.getContextPath()%>/user/exit'>安全退出</a></h2>
    <h1 align='center'>Mail Page</h1>
    <table align='center' border='1px'>
      <tr>
        <th align='center'>Username</th>
        <th align='center'>Password</th>
        <th align='center'>Phone</th>
        <th align='center'>Address</th>
        <th align='center' colspan='2'>Other Operation</th>
      </tr>
      <%
        List<Tail> tails = (List)request.getAttribute("tails");
        for(Tail tail:tails){
          String username = tail.getUsername();
          String password = tail.getPassword();
          String phone = tail.getPhone();
          String address = tail.getAddress();
          %>
      <tr>
        <td align='center'><%=username%></td>
        <td align='center'><%=password%></td>
        <td align='center'><%=phone%></td>
        <td align='center'><%=address%></td>
        <td align='center'><a href='<%=request.getContextPath()%>/tail/detail?username=<%=username%>'>修改</a></td>
        <td align='center'><a href='<%=request.getContextPath()%>/tail/delete?username=<%=username%>'>删除</a></td>
      </tr>

      <%
        }
      %>
    </table>

<hr color='pink'>
<a href='<%=request.getContextPath()%>/add.jsp'>添加通讯录</a>

</body>
</html>
